package com.xupt.ttms.pojo;

import lombok.Data;
import lombok.ToString;
import org.springframework.stereotype.Component;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Objects;

@Data
@Component
@ToString
public class Order  implements Serializable {
    private static final long serialVersionUID = -6186165618109400238L;
    private Integer id;
    private String orderNo;//订单号
    private String status="0";// 0:"待支付"，1:"已支付"，2:“用户已退票“,3:"售票员已退票",-1:"已过期"
    private BigDecimal amount;//金额
    private String desc;
    private Integer userId;
    private Date purchaseTime;//订单支付时间
    private Date generateTime;//订单生成时间
    private Date expireTime;//过期时间
    private List<Seat> seats;//订单对应的座位
    private String mName;//订单对应的电影
    private String startDate;//订单对应的演出计划
    private String hname;//订单对应的演出厅

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Order order = (Order) o;
        return Objects.equals(orderNo, order.orderNo) && Objects.equals(status, order.status) && Objects.equals(amount, order.amount) && Objects.equals(desc, order.desc) && Objects.equals(userId, order.userId) && Objects.equals(purchaseTime, order.purchaseTime) && Objects.equals(generateTime, order.generateTime) && Objects.equals(expireTime, order.expireTime) && Objects.equals(mName, order.mName) && Objects.equals(startDate, order.startDate) && Objects.equals(hname, order.hname);
    }

    @Override
    public int hashCode() {
        return Objects.hash(orderNo, status, amount, desc, userId, purchaseTime, generateTime, expireTime, mName, startDate, hname);
    }
}
